﻿using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using BlawkayEngine;
using BlawkayEngine.Drawing;

namespace BlawkayEngine.ScreenSystem
{
    public class BackgroundScreen : Screen
    {

        public BackgroundScreen(Game oGame, string oPath) 
            : base(oGame)
        {
            Texture2D oTexture = oGame.Content.Load<Texture2D>(oPath);
            Visible = true;
            Transition = 0.0f;
            TransitionRate = 1f / 60f;

            _Background = new SpriteR(oTexture, new Rectangle(0, 0, GameInfo.Resolution.Width, GameInfo.Resolution.Height));
            _Background.Layer = 0;
        }

        public override void Update(ScreenManager oManager)
        {
        }

        public override void Draw(ScreenManager oManager, SpriteBatch oSB)
        {
            _Background.Draw(oSB, Transition);
        }

        public override void ActionWhenFullyAdded(ScreenManager oManager)
        {
        }

        public override void ActionWhenFullyRemoved(ScreenManager oManager)
        {
        }

        SpriteR _Background;

    }
}
